/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * */
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
  const { currentUser } = initialState || {};
  return {
    canAdmin: currentUser && currentUser.access?.includes('admin'),
    //登录后加载所有权限数组，特殊权限根据需要，添加判断是否存在即可。对应menuRule表name字段
    canSameOpt: currentUser && currentUser.access?.includes('canSameOpt'),
    //demo
    canSsm: currentUser && currentUser.access?.includes('ssm'),
  };
}
